import logging
import settings

logger = logging.getLogger(__name__)

formatter = logging.Formatter(
    '%(asctime)s - %(levelname)s - %(pathname)s:%(lineno)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S')

file_handler = logging.FileHandler(settings.LOG_FILE_PATH)
file_handler.setLevel(logging.ERROR)
file_handler.setFormatter(formatter)

logger.addHandler(file_handler)
